package sma.agents;

import java.util.ArrayList;

import sma.guis.*;
import sma.infos.*;
import jade.core.Agent;
import jade.core.behaviours.*;

public class Employe extends Agent {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private EmployeGui myGui;
	private ArrayList<InfoCV> myInfoCV;
	
	public void setup(){
		myInfoCV = new ArrayList<InfoCV>();
		myGui = new EmployeGui(this);
		System.out.println("avant afficher l'ecran Employe");
		myGui.showGui();
	}
	
	public void insererCandidature(final InfoCV cv){
		this.addBehaviour(new OneShotBehaviour() {
			
			/**
			 * 
			 */
			private static final long serialVersionUID = 1L;

			@Override
			public void action() {
				// TODO Auto-generated method stub
				InfoCV info = new InfoCV(cv.getInfoPersonnelles());
//				info.setInfoPersonnelles(cv.getInfoPersonnelles());
				info.setAnneeExperiences(cv.getAnneeExperiences());
				info.setBranche(cv.getBranche());
				info.setNomBranche();
				info.setLieuTravail(cv.getLieuTravail());
				info.setSalaireSouhaite(cv.getSalaireSouhaite());
				info.setLanguagesEtrangeres(cv.getLanguagesEtrangeres());
				
				myInfoCV.add(info);
				
				System.out.println("Inserer info personnelle d'employe" + myInfoCV.size());
				for (int i = 0; i < myInfoCV.size(); i++)
					myInfoCV.get(i).displayInfoVC();
			}
		});
	}
		
	public void displayInfosEmploye(){
		
	}
	
	private class ChercherPosteInit extends CyclicBehaviour{
		public void action(){
			
		}
	}
	
	private class DeposerCandidature extends Behaviour{
		public void action(){
			
		}
		
		public boolean done(){
			return false;
		}
	}
	
	private class RecruterInit extends Behaviour{
		public void action(){
			
		}
		
		public boolean done(){
			return false;
		}
	}
}
